UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6kYuJKiAf0yWrbq82/UB9aU1leg/uv3mMwGDuE+KseU=' 
WHERE 
  key_id = '33ae10c1e8955b210e6d84cc7fbf26344fd2ad71a0f44e97645fbbe7719f348c' 
  AND (
    token = '6kYuJKiAf0yWrbq82/UB9aU1leg/uv3mMwGDuE+KseU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025