UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vWsaLHtN6gVkxaxsAS2PWKAKI9+To9tZ3KKlgimytCk='
WHERE
key_id = 'edb118f1cb29882b0084dab00c6998bdc582c7e647b607623987359a4d6ea2e0'
AND (
token = 'vWsaLHtN6gVkxaxsAS2PWKAKI9+To9tZ3KKlgimytCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)