UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qZuT9FqOL5mTFiK8ZkUXzIC/75kcfTJhJz3wv6G6g1s='
WHERE
key_id = 'c44efc2ccd8462d0b30e396f9971c1792274585194bdfc7578073b0033174348'
AND (
token = 'qZuT9FqOL5mTFiK8ZkUXzIC/75kcfTJhJz3wv6G6g1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)