UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Xbm+YOJScP+gqxxRVeVObsbwBvi869HOI/3RWohNwY='
WHERE
key_id = '09f5e6f086d29acc600cfa3c3d8ee43c7c483de86650c27583dcdd722b78346a'
AND (
token = '5Xbm+YOJScP+gqxxRVeVObsbwBvi869HOI/3RWohNwY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)