UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ReaprM7gUZHPXwWPjrZXdO7xqzkajVO0EYB/J7ysRvo=' 
WHERE 
  key_id = '86a036f325568e7312073a3de61e3de65fc1b29fe106b015d27544442f42cc21' 
  AND (
    token = 'ReaprM7gUZHPXwWPjrZXdO7xqzkajVO0EYB/J7ysRvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00103