UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oe/kTgzR+Qfe6JYWmMVysQOktS9pdfioe291mwhW8fg='
WHERE
key_id = '0f5a75020f2d75fcf2e80b39bf1217b427987101367a40c32b4016606b279ea0'
AND (
token = 'oe/kTgzR+Qfe6JYWmMVysQOktS9pdfioe291mwhW8fg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)