UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Pj8qeZke7eWw/EwnZOsN+Dx1IPHhK649RWpYbW01xw='
WHERE
key_id = '19c464314175be7f6025f265015082287e07c354b2ac5136805830e994151224'
AND (
token = '9Pj8qeZke7eWw/EwnZOsN+Dx1IPHhK649RWpYbW01xw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)