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