UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OaOgVvgGtgXbq5/aVZyNpabSPxWKe6To9RD137FWoFk='
WHERE
key_id = 'b05c3eec9725fdc0efe4e24c910bf338a7b266a0199cf328cdfdf4c289880426'
AND (
token = 'OaOgVvgGtgXbq5/aVZyNpabSPxWKe6To9RD137FWoFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)