UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3e6fkGwKFZ+KQNueQSNmKXQ8LR3j+Det4Olb/11m5FA='
WHERE
key_id = '2d6c8a3ab16f67079744071bfacfd93bb38522ddb4297d6ad42a35a73ca49066'
AND (
token = '3e6fkGwKFZ+KQNueQSNmKXQ8LR3j+Det4Olb/11m5FA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)