UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Xd9AFn60lGZmMvhT4svLsFj8flsQ/mUi9pOP0tbFhw='
WHERE
key_id = '1f2a7a99b9e84aef4441111f801604f71284f4c71ef1549abe0f93cc926e848d'
AND (
token = '8Xd9AFn60lGZmMvhT4svLsFj8flsQ/mUi9pOP0tbFhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)