UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/8JJ8w1vr5h4MCZAmqykj/GED3NzvcYgQgW2EAuhPKg='
WHERE
key_id = '6dd1dc6c75dc14752d96f562c3b6d708787fe3fb6e10c6229729ba777292cc47'
AND (
token = '/8JJ8w1vr5h4MCZAmqykj/GED3NzvcYgQgW2EAuhPKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)