UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qo07H5Q7PYpnGvb4WbvHAs5XGOgd2YI7FngDxwGwFNk=' 
WHERE 
  key_id = '609920af4d0c719e2d43e2582fcfa16e61e6c87e3e28d93b4ff136584e17ef1f' 
  AND (
    token = 'qo07H5Q7PYpnGvb4WbvHAs5XGOgd2YI7FngDxwGwFNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00080