UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VKG8wd2NRqSFCqLEO/sgVhsmny4hpgMaXcQKfn5IM0A=' 
WHERE 
  key_id = 'c7436e5a844ba1e44b89171acf361f9a4b3b44f3e93a95a4393e86cb4fa14315' 
  AND (
    token = 'VKG8wd2NRqSFCqLEO/sgVhsmny4hpgMaXcQKfn5IM0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031