UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L08bYRwewHlJQWx7GgKWWWEBPwCzr2IM7nYZeb7362E=' 
WHERE 
  key_id = '647b923a827711d7f39e9c3ed29f4d293088c3ba1cc16c3bfcae97976d019939' 
  AND (
    token = 'L08bYRwewHlJQWx7GgKWWWEBPwCzr2IM7nYZeb7362E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032