UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gK1o2iQRn9IgfdUKhcO6+uOjkJyYMrmLu/aRySQ9VjY=' 
WHERE 
  key_id = '7010f8ba9ff8bf7c4d3aa61979260fd104d7ee34a6a7b6acb6545ad47f0e9bae' 
  AND (
    token = 'gK1o2iQRn9IgfdUKhcO6+uOjkJyYMrmLu/aRySQ9VjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035