UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rtToVf5tPWKyUGcAFJ4m1+XUdHqkWEP/pL2vc5vPF8g=' 
WHERE 
  key_id = 'bc2f9662b19884e15208aa5763258f7eeaea50e5aaa3ae4a87b4ea745e8fda3c' 
  AND (
    token = 'rtToVf5tPWKyUGcAFJ4m1+XUdHqkWEP/pL2vc5vPF8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055