UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't7hJq+JRihy1xIxTu744QDfVG5BdjbFvHOzK3bUcWeg='
WHERE
key_id = '16d35655443bfa20d5729db62d1f4987349f7298b194efd200d0b237b1fce23c'
AND (
token = 't7hJq+JRihy1xIxTu744QDfVG5BdjbFvHOzK3bUcWeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)