UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D5xkkiYkJ5RjCK/nYk7OBMF9GDTVvYd3u0KCt7CHNPU=' 
WHERE 
  key_id = 'fbaa44d1d9191ad75bd248af3e5dd4c0e86b6422fe47a9ded422ae5e25421eaa' 
  AND (
    token = 'D5xkkiYkJ5RjCK/nYk7OBMF9GDTVvYd3u0KCt7CHNPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027