UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wg276YhAirZNFJGdZwyGeAoqlUdk+lbSVMQgpKqzNmE=' 
WHERE 
  key_id = 'f90baed97e718e1a3dad4477f565c35abd8d41e9ab13bb0eb5a252964b468b03' 
  AND (
    token = 'Wg276YhAirZNFJGdZwyGeAoqlUdk+lbSVMQgpKqzNmE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042