UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EOMUEAWzUCXM0nomcm5ZG7yoFfAqMb37CQcjcYRONaM=' 
WHERE 
  key_id = 'bf10c26468b7ad7b56aa0f0c2b348187557f84282382636d75f8b31dedb515e5' 
  AND (
    token = 'EOMUEAWzUCXM0nomcm5ZG7yoFfAqMb37CQcjcYRONaM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019