UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JQoV8Z1gnOlNGdKtKsoEG7wBKg8B+uBqeWPXOgsFvVY=' 
WHERE 
  key_id = 'ce91ed644028c18fc5ebeeb7c834915cd0fc28521f22a4713c70d4403ecbc17d' 
  AND (
    token = 'JQoV8Z1gnOlNGdKtKsoEG7wBKg8B+uBqeWPXOgsFvVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058