UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8mEAKPEqPxU4G9KYZeR0YLtZ119gKDBlzLJKUsxAvp0='
WHERE
key_id = '66a7b88f3776a92bda7d26ab4c23eeb1b2a548f10c36d4426730b83b67c241a2'
AND (
token = '8mEAKPEqPxU4G9KYZeR0YLtZ119gKDBlzLJKUsxAvp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)