UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4FYuP76LaLVGaSSMmG4mfVXnGo1f4GL788dL5oU6KNw=' 
WHERE 
  key_id = 'bf22af66332c955f99fc64ef810540508cdc3fb630535ed83c7bba96210b62ad' 
  AND (
    token = '4FYuP76LaLVGaSSMmG4mfVXnGo1f4GL788dL5oU6KNw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022