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