UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hi+qe1Q+xFXhj3S1nIXvHlCtOZUNd8N7idO/0/Es/p8=' 
WHERE 
  key_id = '07213cfe2f67504c91fcfdc7382a3dc71d0e89017912780ca83c1dcb3facc9d7' 
  AND (
    token = 'hi+qe1Q+xFXhj3S1nIXvHlCtOZUNd8N7idO/0/Es/p8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030