UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OBvlA+dVK8Zrtq/iIzWp33U0PYKAftDiH7b7OgaBIho=' 
WHERE 
  key_id = '5b3db76edbe4a6d13d49b100fbd6a00ca117c0c1721f79def92f69afc261f1a9' 
  AND (
    token = 'OBvlA+dVK8Zrtq/iIzWp33U0PYKAftDiH7b7OgaBIho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021