UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nMSUXl4fQlqeQ1Jmzr29pFKYUn+ReyEQ+6A8dF5Mz1s=' 
WHERE 
  key_id = 'cbfe07a3c797ee14d2321a318946ec8f406b0e77fd616fb4ee01bff886a36c08' 
  AND (
    token = 'nMSUXl4fQlqeQ1Jmzr29pFKYUn+ReyEQ+6A8dF5Mz1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023