UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '99UkNkXWT0x0H7Q7EfzHIzVTjQe+TXN/MnUlPP3e7kQ=' 
WHERE 
  key_id = 'bfa7517299c8f92b0c990b3612b95c7fcc20d414a71191eb160191db0b0c5370' 
  AND (
    token = '99UkNkXWT0x0H7Q7EfzHIzVTjQe+TXN/MnUlPP3e7kQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039