UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Rx93uVRUB4P5YGWtcD/XdKiPUmwmHQ3AKWLCIckLhk=' 
WHERE 
  key_id = '65aa1f7455ace2b0520b39455f82a09d48af775e7a46927ec1e4f59ff9660f63' 
  AND (
    token = '0Rx93uVRUB4P5YGWtcD/XdKiPUmwmHQ3AKWLCIckLhk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016