UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kHtynw+vncn/fBvwl6wxab1BFYGnNJfxQb+8Ib/fH6s=' 
WHERE 
  key_id = '96eacb0270c421f80b0fdab0a661a287c7c8b02fbf3db7be9fdc97064deace05' 
  AND (
    token = 'kHtynw+vncn/fBvwl6wxab1BFYGnNJfxQb+8Ib/fH6s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052