UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rIS2e0QoOHYJgQjjTLQYbxomP61Juyng0tSyLDdtsBM='
WHERE
key_id = '6741ae829fadb93fb564db02cc77649f1d4e9c08bc30e73f97c26d79ce213926'
AND (
token = 'rIS2e0QoOHYJgQjjTLQYbxomP61Juyng0tSyLDdtsBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)