UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '//sWSoMoyb5Hmvgftw9VnUmIKLu8EAoGl7+6PV5WJRc='
WHERE
key_id = '35fc739306209452453897fbb015163dd8d0d6e8ee88a384e55afa81c0d7e276'
AND (
token = '//sWSoMoyb5Hmvgftw9VnUmIKLu8EAoGl7+6PV5WJRc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)