UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WclLn02GtyXkayk/gqSKxesUtzRi0QmdCRCpxo+BaLU='
WHERE
key_id = 'c3ead2fa9eb90de2a1efb7b7125cfaf81dcc0e82f699a73f4be978e2702c0daf'
AND (
token = 'WclLn02GtyXkayk/gqSKxesUtzRi0QmdCRCpxo+BaLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)