UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mkJBXtOFpMHaYmKHl5GhgR0oCQCU1SpzgYhr5BTXSig=' 
WHERE 
  key_id = '6750045173afb252271a17d7c2e238fa54daf1c834444511fa0c2dae331a6e6c' 
  AND (
    token = 'mkJBXtOFpMHaYmKHl5GhgR0oCQCU1SpzgYhr5BTXSig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038