UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SU75mqFlnM7gYoOBCGESXPFfl73sIVqGKbE6cqn+uxY=' 
WHERE 
  key_id = 'c66126e4d1213b55f3d8b43a9f07afebaf58ee43b34003a1b0e56e6b5204740d' 
  AND (
    token = 'SU75mqFlnM7gYoOBCGESXPFfl73sIVqGKbE6cqn+uxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030