UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3R6YXHsiq1y4LfhZH+cnDRXcqRznwdDbpyvxpYrGq1k=' 
WHERE 
  key_id = '2a48d7c26e11f0d4ac74f12a5ccc92ad8dc5c391f4220574ef4304bb76de3b9f' 
  AND (
    token = '3R6YXHsiq1y4LfhZH+cnDRXcqRznwdDbpyvxpYrGq1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048