UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '09Ofx6L+FpuMFLurVQ9kNP8Mqeo3RFJQZxKjczEe6VY=' 
WHERE 
  key_id = '46996d8986bc1a660b442f464a2206a20b3b0108c25059804fca091eda0644d2' 
  AND (
    token = '09Ofx6L+FpuMFLurVQ9kNP8Mqeo3RFJQZxKjczEe6VY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038