UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p3/xNHD0F+U3weyV4SyYiwllXgDYX9Nm9z/EOoQ08SY=' 
WHERE 
  key_id = 'd5973a3bf0b95804dbbf9f611851d5939f4b58e3af4c38082300a4eebeacb64f' 
  AND (
    token = 'p3/xNHD0F+U3weyV4SyYiwllXgDYX9Nm9z/EOoQ08SY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023