UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mUfvB8S6vYKpWY29Qd/kU1qxfIeFgPg7qCIhOGAIjtk='
WHERE
key_id = '5d515cf6979066f9a5edfd70cdafe3423ec3bd09161e6192c92b0e3804cf6c87'
AND (
token = 'mUfvB8S6vYKpWY29Qd/kU1qxfIeFgPg7qCIhOGAIjtk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)