UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Na8NLwoDxpNcAE5HGwz6QyFr0EjOJaKTudHGPBsZi0='
WHERE
key_id = '7d548a7429c05ef3565abea978b49ded987d1738c2fcce16f845ca561f6ae127'
AND (
token = '1Na8NLwoDxpNcAE5HGwz6QyFr0EjOJaKTudHGPBsZi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)