UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '64ogjm25nMBgIY0z8n1nYSRMX6NxaFk5aAG9IYP7Bxw=' 
WHERE 
  key_id = '7c9bccdc95672920888b0712fbe8c18104597bd797644ec347b09a9c7241a8a8' 
  AND (
    token = '64ogjm25nMBgIY0z8n1nYSRMX6NxaFk5aAG9IYP7Bxw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044