UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OumgpJdWbb4kUd51S8ifDpnVWuSm/tbDVNnUQ9RvXvo=' 
WHERE 
  key_id = '85ca27d57e74dd6086cb71decf7f2884db5a56bfd2284eb9c34c8e4d3d48e814' 
  AND (
    token = 'OumgpJdWbb4kUd51S8ifDpnVWuSm/tbDVNnUQ9RvXvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029