UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cPYv1bdzw1OmubZ/qtmQFeMlz7BmK3r6Kn/hc56jd1k=' 
WHERE 
  key_id = 'fc35f77f3b028e07b67475a8e239dab392c6d53d6fd9e003af7881cf39d8a5df' 
  AND (
    token = 'cPYv1bdzw1OmubZ/qtmQFeMlz7BmK3r6Kn/hc56jd1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026