UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LbWoSeY9hyrBxQrLh3lwBI1RAX2X6xBaq+2lgOFUx+g=' 
WHERE 
  key_id = '960bfb5f4176cac1c6e5c738583f063641f2204fb951d0c51c266029a9d0928c' 
  AND (
    token = 'LbWoSeY9hyrBxQrLh3lwBI1RAX2X6xBaq+2lgOFUx+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040