UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M8Aim9gvpNyHdwB1/VnEPum2our1XnCMtG2ZVuG7098=' 
WHERE 
  key_id = '0c78024bb33b9f3db276f49fd3c5fa24094d018866562c5eeccf33ed71f86aa2' 
  AND (
    token = 'M8Aim9gvpNyHdwB1/VnEPum2our1XnCMtG2ZVuG7098=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034