UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UJ9x6TI5KZ7RGRJsx3OSlbldpI7IUDTGpoTkwvphsYc=' 
WHERE 
  key_id = '7de4e3b27b789c26c7908ceb5336a7fd1503ae7afcf13dbf3e01d3aa622bf1bf' 
  AND (
    token = 'UJ9x6TI5KZ7RGRJsx3OSlbldpI7IUDTGpoTkwvphsYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032