UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zYDCIwZSe5WdpXIl1XfaDwwZokxcFD2oq4HB3WEMs4k=' 
WHERE 
  key_id = '5ebdcfda2979ce978082b3e8464417e7f79c90059efbed8dde8187b9ae335a3c' 
  AND (
    token = 'zYDCIwZSe5WdpXIl1XfaDwwZokxcFD2oq4HB3WEMs4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022