UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mcpHtpgodbfsqUniZNNk0ZFPMdArkkgEVTX8YfTq5dw=' 
WHERE 
  key_id = 'ea24e3dd3d12692166120c854d6b87ca9b55f1eec74b8f7b5b066736ddee7012' 
  AND (
    token = 'mcpHtpgodbfsqUniZNNk0ZFPMdArkkgEVTX8YfTq5dw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052